package com.dx.wx.controller;

import com.dx.wx.service.DxNewsService;
import com.dx.wx.service.DxWorkService;
import com.ejlchina.data.Array;
import com.yf.annotation.LoginUserId;
import com.yf.response.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/dx/work/sign")
public class ApiDxWorkController {


    @PostMapping("/")
    public R save(@LoginUserId Long phone,@RequestBody Map map){
       dxWorkService.saveWork(phone,map);
        return R.ok();
    }


    @GetMapping
    public R list(@LoginUserId Long phone,Long startDate,Long endDate){
       Array array = dxWorkService.listWork(phone,startDate,endDate);
       return R.ok(array.toString());
    }


    @Autowired
    private DxWorkService dxWorkService;

}
